<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="isemirbarkod" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{isemirbarkodHome.managed ? 'Edit' : 'Add'} Isemirbarkod</f:facet>



            <s:decorate id="barkodField" template="layout/edit.xhtml">
                <ui:define name="label">Barkod</ui:define>
                <h:inputText id="barkod" required="true" value="#{isemirbarkodHome.instance.barkod}"/>
            </s:decorate>

        <s:decorate id="barkodturu" template="layout/edit.xhtml">
            <ui:define name="label">Barkodturu</ui:define>
            <h:selectOneMenu id="gender" value="#{isemirbarkodHome.instance.barkodturu}">
			  <f:selectItems value="#{isemirbarkodHome.barkodTuru}" />
<!--			  <s:convertEnum/>-->
			</h:selectOneMenu>
        </s:decorate>

<!--            <s:decorate id="barkodturuField" template="layout/edit.xhtml">-->
<!--                <ui:define name="label">Barkodturu</ui:define>-->
<!--                <h:inputText id="barkodturu"-->
<!--                       required="true"-->
<!--                           size="20"-->
<!--                      maxlength="20"-->
<!--                          value="#{isemirbarkodHome.instance.barkodturu}">-->
<!--                    <a:support event="onblur" reRender="barkodturuField" bypassUpdates="true" ajaxSingle="true"/>-->
<!--                </h:inputText>-->
<!--            </s:decorate>-->



            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{isemirbarkodHome.persist}"
                       disabled="#{!isemirbarkodHome.wired}"
                       rendered="#{!isemirbarkodHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{isemirbarkodHome.update}"
                       rendered="#{isemirbarkodHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{isemirbarkodHome.remove}"
                      immediate="true"
                       rendered="#{isemirbarkodHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/Isemirbarkod.xhtml"
                rendered="#{isemirbarkodHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty isemirbarkodFrom ? 'IsemirbarkodList' : isemirbarkodFrom}.xhtml"
                rendered="#{!isemirbarkodHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">

    <rich:tab label="Isemir *" labelClass="required">
    <div class="association" id="isemirParent">

        <h:outputText value="There is no isemir associated with this isemirbarkod."
                   rendered="#{isemirbarkodHome.instance.isemir == null}"/>

        <rich:dataTable var="_isemir"
                   value="#{isemirbarkodHome.instance.isemir}"
                rendered="#{isemirbarkodHome.instance.isemir != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="isemirTable">
        <h:column>
            <f:facet name="header">Id</f:facet>
            <h:outputText value="#{_isemir.id}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Isemirno</f:facet>
            <h:outputText value="#{_isemir.isemirno}"/>
        </h:column>
        <h:column rendered="#{authenticator.isAdmin()}">
            <f:facet name="header">Firma id</f:facet>
            <h:outputText value="#{_isemir.firma.ad}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Isemirtarihi</f:facet>
            <h:outputText value="#{_isemir.isemirtarihi}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header">Isletme id</f:facet>
            <h:outputText value="#{_isemir.isletme.ad}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Siparisno</f:facet>
            <h:outputText value="#{_isemir.siparisno}"/>
        </h:column>        
        <h:column>
            <f:facet name="header">Urun id</f:facet>
            <h:outputText value="#{_isemir.urun.urunno} - #{_isemir.urun.adi} ( #{_isemir.urun.kalip.kod} #{_isemir.urun.ambalaj})"/>
        </h:column>        
        <h:column>
            <f:facet name="header">Musteri id</f:facet>
            <h:outputText value="#{_isemir.musteri.ad}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Planlananadet</f:facet>
            <h:outputText value="#{_isemir.planlananadet}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Termintarihi</f:facet>
            <h:outputText value="#{_isemir.termintarihi}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header">Ulke id</f:facet>
            <h:outputText value="#{_isemir.ulke.ad}"/>
        </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{isemirbarkodHome.instance.isemir != null ? 'changeParent' : 'selectParent'}" value="#{isemirbarkodHome.instance.isemir != null ? 'Change' : 'Select'} isemir"
                       view="/IsemirList.xhtml">
                <f:param name="from" value="IsemirbarkodEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
